package com.itheima.controller;

import com.itheima.pojo.*;
import com.itheima.service.NursingLevelService;
import com.itheima.service.NursingPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/nurseplann")
@RestController
public class NursingPlanController {



    @Autowired
    private NursingPlanService nursingPlanService;


    /***
     * 分页查询
     */
    @GetMapping
    public Resultwo list(NursingPlanQueryParam nursingPlanQueryParam){
        // 调用Service查询->PageResult
        PageResultwo pageResultwo = nursingPlanService.listwo(nursingPlanQueryParam);
        //响应数据
        return Resultwo.success(pageResultwo);
    }

    //    新增
    @PostMapping
    public Resultwo add(@RequestBody NursingPlan nursingPlan){
        return Resultwo.success(nursingPlanService.add(nursingPlan));

    }
}
